using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class SkillManager {
	
	static string typeName = "Skill";
	
	static GenericManager<Skill> _m;
	static GenericManager<Skill> m
	{
		get
		{
			if(_m == null)
				_m = new GenericManager<Skill>(typeName);
			return _m;
		}
	}
	
	public static Dictionary<string,string> index
	{
		get
		{
			return m.index;
		}
	}
	
	public static Skill Load(string name)
	{
		return m.LoadObject(name);
	}
	
	public static bool isCustom(string name)
	{
		return m.isCustom(name);
	}
		
	public static Skill AddSkill(string name, string description, string keyStat, bool armorCheckPenalty, bool trainedOnly)
	{
		Skill a = new Skill();
		a.name = name;
		a.description = description;
		a.stat = keyStat;
		a.armorCheckPenalty = armorCheckPenalty;
		a.trainedOnly = trainedOnly;
		
		return m.AddObject(a);
	}
	
	public static bool SaveSkill(Skill s, string file)
	{
		return m.SaveObject(s, file);
	}
	
	public static void DeleteSkill(string name)
	{
		m.DeleteObject(name);
	}
}
